/**
 * 查找字符串 _sub 并返回 _sub 左右共计 _len 字符长度的子字符穿 并高亮显示 _sub 字符串 用到 class="light"\
 * @param {String}	_str
 * @param {String} _sub
 * @param {Number} _len
 */
FWK.searchStr = function(_str,_sub,_len){
	var _str = _str.replace(/<[^>]*>/g,"");
	_str = _str.replace(/\s/g,"");
	var slen = _str.length;
	if(slen<=_sub.length)return _str.replace(_sub,"<span class='light'>" + _sub + "</span>");
	var ulen = _sub.replace(/[^\x00-\xff]/g,"**").length;
	if(_len<=ulen)return "<span class='light'>" + _sub + "</span>";
	
	var index = _str.indexOf(_sub);
	var sslen =  _str.replace(/[^\x00-\xff]/g,"**").length;
	if(index<0){
		var rStr = [];
		var i=0,m=0;
		while(i<_len && m<=slen){
			var n = _str.charAt(m);
			i+=n.replace(/[^\x00-\xff]/g,"**").length;
			m+=1;
			rStr.push(n);
		}
		if(m<slen)rStr[rStr.length-1] = "..";
	}
	else{
		var rStr = ["<span class='light'>" + _sub + "</span>"];
		var mid = Math.round((_len-ulen) / 2);
		var i=0,m=0;
		while(i<=mid && m<index){
			var n = _str.charAt(index-m-1);
			rStr.unshift(n);
			i+=n.replace(/[^\x00-\xff]/g,"**").length;
			m+=1;
		}
		if(m<index)rStr[0] = "..";
		mid = mid + mid - i;
		
		i=0,m=index +  _sub.length;
		while(i<=mid && m<=slen){
			var n = _str.charAt(m);
			rStr.push(n);
			i+=n.replace(/[^\x00-\xff]/g,"**").length;
			m+=1;
		}
		
		if(m<slen)rStr[rStr.length-1] = "..";
	}
	return rStr.join("");
}